package cc.rengu.igas.bomp.facade.enums;

/**
 * 商户性质
 */
public enum BompMchntNatureEnum {
    WECHAT("01", "小微商户", "02"),
    INDIVIDUAL_INDUSTRIAL("02", "个体工商户", "02"),
    ENTERPRISE("03", "企业", "01"),
    GOVERNMENT_AFFILICATED_INSTITUTION("04", "党政、机关及事业单位", "03"),
    OTHER("99", "其他组织", "04"),

    ;

    public static String getMchntNatureByWechatMchntType(String wechatMchntType) {
        if (null == wechatMchntType || "".equals(wechatMchntType)) {
            return null;
        }

        for (BompMchntNatureEnum bompMchntNatureEnum : values()) {
            if (bompMchntNatureEnum.getWechatPublicPrivateKey().equals(wechatMchntType)) {
                return bompMchntNatureEnum.getMchntNature();
            }
        }
        return null;
    }

    public static BompMchntNatureEnum getBompMchntNatureEnumByType(String mchntNature) {
        if (null == mchntNature || "".equals(mchntNature)) {
            return null;
        }

        for (BompMchntNatureEnum bompMchntNatureEnum : values()) {
            if (bompMchntNatureEnum.getMchntNature().equals(mchntNature)) {
                return bompMchntNatureEnum;
            }
        }
        return null;
    }

    private String mchntNature;

    private String desc;

    /**
     * 企业性质             微信经营类型映射关系
     * 企业                 01-对公
     * 小微/个体            02-对私
     * 党政、机关及事业单位  03-党政、机关
     * 其他组织             04-其他
     */
    private String wechatPublicPrivateKey;

    public String getMchntNature() {
        return mchntNature;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 01-对公
     * 02-对私
     * 03-党政、机关
     * 04-其他
     *
     * @return
     */
    public String getWechatPublicPrivateKey() {
        return wechatPublicPrivateKey;
    }

    BompMchntNatureEnum(String mchntNature, String desc, String wechatPublicPrivateKey) {
        this.mchntNature = mchntNature;
        this.desc = desc;
        this.wechatPublicPrivateKey = wechatPublicPrivateKey;
    }
}
